﻿using System;
using System.Collections.Generic;
using HAVNet.Core;


namespace HAVNet.Intros.AST
{
    public class ASTExprPrimNew : ASTExprPrim
    {
        public override string ToString()
        {
            return "<<<<<<<< NEW >>>>>>>>";
        }
    }

    public class ASTExprPrimNewTypeArgs : ASTExprPrim
    {
        ASTArguments _args = null;

        public ASTType                  type    { get; set; }
        public ASTArguments             args    { get { if (_args == null)_args = new ASTArguments(); return _args; } }
        public ASTObjectOrCollecInit    oci     { get; set; }

        public override string ToString ()
        {
            return "new " + type + "(" + Lazy.toStringNN(_args, "") + ")" + Lazy.toStringNN(oci, "");
        }
    }

    public class ASTExprPrimNewObjInit : ASTExprPrim
    {
        public ASTType                  type    { get; set; }
        public ASTObjectOrCollecInit    oci     { get; set; }

        public override string ToString ()
        {
            return "new " + type + " " + oci;
        }
    }
}
